package com.sy.pet.controller;

import com.sy.pet.commom.ResultBean;
import com.sy.pet.dto.UserDTO;
import com.sy.pet.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/register")
public class RegisterController {
    @Autowired
    UserService userService;
    @PostMapping
    public ResultBean<String> register(@RequestBody @Valid UserDTO dto) {
        userService.register(dto);
        return ResultBean.success();
    }
}
